{% extends "base.html" %}

{% block content %}

    {% if user.is_authenticated %}
        <h2 class="examsH2">Exams Today </h2>
        <div>
            <table>
                <tr>
                    <th>Exams </th>
                    <th>Start date</th>
                    <th>End date</th>
                </tr>
                {% for exam in examByToday %}
                <tr>
                    <td><a href="/takeExam/{{ exam.id }}">{{ exam.name }}</a></td>
                    <td>{{ exam.examStartDay }} </td>
                    <td>{{ exam.examEndDay }} </td>

                </tr>
                {% endfor %}
            </table>
        </div>

        <div>
        <h2 class="examsH2">Future Exams</h2>

            <table >
                <tr>
                    <th>Exams </th>
                    <th>Start date</th>
                    <th>End date</th>

                </tr>
                {% for exam in examFuture %}
                    <tr>
                        <td>{{ exam.name }}</td>
                        <td>{{ exam.examStartDay }} </td>
                        <td>{{ exam.examEndDay }} </td>
                    </tr>
                {% endfor %}
            </table>
        </div>

        <div>
        <h2 class="examsH2">Expired Exams</h2>

            <table>
                <tr>
                    <th>Exams </th>
                    <th>Start date</th>
                    <th>End date</th>
                </tr>
                {% for exam in examExpired %}
                    <tr>
                        <td>{{ exam.name }}</td>
                        <td>{{ exam.examStartDay }} </td>
                        <td>{{ exam.examEndDay }} </td>
                    </tr>
                {% endfor %}
            </table>
        </div>

    {% else %}
        <p>Welcome, new user. Please log in.</p>
    {% endif %}

{% endblock %}